package com.hippo.javacore.javaiostream.iostream;

import java.io.DataOutputStream;
import java.io.FileOutputStream;

/**
 * @ClassName DataOutputStreamOpt
 * @Description TODO 字节数据输出流操作类
 * @Author tangxl
 * @create 2023-04-07 10:13
 **/
public class DataOutputStreamOpt {
    public static void main(String[] args) {
        try(
                // 创建一个数据字节输出流对象
                DataOutputStream dos = new DataOutputStream(new FileOutputStream("study-commons/java-file-iostream/src/main/resources/file/a.txt"));
                ) {
            dos.writeInt(97);
            dos.writeDouble(3.14);
            dos.writeUTF("你好中国");
            dos.writeBoolean(true);
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}
